Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2405: Crypto Changes [Rebase & FF] #951

Merged
merged 13 commits into from
Jun 26, 2024

Conversation

makubacki
Copy link
Member

@makubacki makubacki commented Jun 25, 2024

Description

Closes #871

All CryptoPkg changes to match the release/202311 branch.

Updates some other packages to account for changes in libraries
used in CryptoPkg.


Transition to Latest Shared Crypto

Updates to the code to match the latest Shared Crypto code in the
release/202311 branch using the 2023.11.3 binary.

For Shared Crypto details and platform integration information,
review https://github.com/microsoft/mu_crypto_release.

Other notable changes consolidated in this commit include:

  • Reconfigures OpensslLib to add elliptic curve cipher algorithms.
  • Fixes a memory free bug in the HmacTest
    • Test is currently using FreePool() when it should use HmacSha256Free()
  • Adds SHA384 and SHA512 to the STANDARD flavor of the crypto binary

Contains the following additional cherry-picked commits.

  • CryptoPkg: CodeQL Fixes (all package CodeQL changes consolidated)
  • [TCBZ3925] Correct the implementation of Pkcs7Sign
  • Fix memory free bug in HmacTest
  • Test is currently using FreePool() when it should use HmacSha256Free()
  • CryptoPkg: Add host-based unit testing
  • TCBZ2997: Use Non-Null CryptPkcs5Pbkdf2 for RuntimeCryptLib.inf
  • Remove support for deprecated crypto from BaseCryptLib.
  • TCBZ2029: Fix AARCH64 Crypto builds
  • Add Variable Argument List macros for VS

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

Includes these 2311 commits:

How This Was Tested

  • Changes from release/202311

Integration Instructions

@makubacki makubacki added type:design-change A new proposal or modification to a feature design type:feature-request A new feature proposal labels Jun 25, 2024
@makubacki makubacki self-assigned this Jun 25, 2024
@github-actions github-actions bot added language:python Pull requests that update Python code impact:breaking-change Requires integration attention impact:security Has a security impact impact:testing Affects testing type:documentation Improvements or additions to documentation labels Jun 25, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jun 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (release/202405@6e64615). Learn more about missing BASE report.

Additional details and impacted files
@@                Coverage Diff                @@
##             release/202405     #951   +/-   ##
=================================================
  Coverage                  ?   44.35%           
=================================================
  Files                     ?      180           
  Lines                     ?    24408           
  Branches                  ?     3478           
=================================================
  Hits                      ?    10827           
  Misses                    ?    13545           
  Partials                  ?       36           
Flag Coverage Δ
MdeModulePkg 17.80% <ø> (?)
MdePkg 51.59% <ø> (?)
NetworkPkg 8.93% <ø> (?)
UefiCpuPkg 39.84% <ø> (?)
UnitTestFrameworkPkg 6.01% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@makubacki makubacki force-pushed the 2405_crypto branch 3 times, most recently from 328c78c to 36e3675 Compare June 25, 2024 22:52
@makubacki
Copy link
Member Author

I'm going to push an update for changing MS_CHANGE/MSCHANGE to MU_CHANGE. Can ignore that in reviews.

dmitryantipov and others added 9 commits June 25, 2024 20:00
Add Variable Argument List macros for VS

Related work items: #15744568
A Mu-specific change to copy/paste the VA macro definitions from
Microsoft Visual Studio\<year>\Enterprise\VC\Tools\MSVC\<version>\include\vadefs.h
causes some macros to be redefined when Google host-based tests
are enabled (e.g. `_ADDRESSOF()`).

This change uses the original definitions in `vadefs.h` to prevent a
macro redefinition error when building host-based unit tests.

Signed-off-by: Michael Kubacki <[email protected]>
Since we need to undefine M_ARM64 to get crypto to build, we add custom macros to let Base.h know we are actually really building ARM (just don't tell crypto)
Test is currently using FreePool() when it should use HmacSha256Free()
The documentation says "DER formatted", but the code was expecting
it to be a pre-processed X509 structure. Add the additional
processing.
Resolves CodeQL issues in the package.

Co-authored-by: Aaron Pop <[email protected]>
Co-authored-by: Kun Qin <[email protected]>
Co-authored-by: Taylor Beebe <[email protected]>
Co-authored-by: Doug Flick <[email protected]>
Co-authored-by: Ken Lautner <[email protected]>
Signed-off-by: Michael Kubacki <[email protected]>
@makubacki
Copy link
Member Author

I'm going to push an update for changing MS_CHANGE/MSCHANGE to MU_CHANGE. Can ignore that in reviews.

Updated

This was linked to issues Jun 26, 2024
@makubacki makubacki changed the title 2405: Crypto Changes 2405: Crypto Changes [Rebase & FF] Jun 26, 2024
CryptoPkg/CryptoPkg.ci.yaml Show resolved Hide resolved
makubacki and others added 4 commits June 26, 2024 12:37
Updates to the code to match the latest Shared Crypto code in the
release/202311 branch using the 2023.11.3 binary.

For Shared Crypto details and platform integration information,
review https://github.com/microsoft/mu_crypto_release.

Other notable changes include:

- Reconfigures OpensslLib to add elliptic curve chipher algorithms.
- Fixes a memory fre bug in the HmacTest
  - Test is currently using FreePool() when it should use HmacSha256Free()
- Adds SHA384 and SHA512 to the STANDARD flavor of the crypto binary

Co-authored-by: Mike Turner <[email protected]>
Co-authored-by: Bret Barkelew <[email protected]>
Co-authored-by: Kenneth Lautner <[email protected]>
Signed-off-by: Michael Kubacki <[email protected]>
Updates the CryptoPkg library instances used after the Shared Crypto
changes in CryptoPkg.

Signed-off-by: Michael Kubacki <[email protected]>
Updates the UefiCpuPkg library instances used after the Shared Crypto
changes in CryptoPkg.

Signed-off-by: Michael Kubacki <[email protected]>
…to is added)"

This reverts commit now that CryptoPkg is buildable and in its final
state for 2405.

Signed-off-by: Michael Kubacki <[email protected]>
@makubacki makubacki enabled auto-merge (rebase) June 26, 2024 16:39
@makubacki makubacki merged commit 7b93967 into microsoft:release/202405 Jun 26, 2024
29 checks passed
@makubacki makubacki linked an issue Jun 26, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:breaking-change Requires integration attention impact:security Has a security impact impact:testing Affects testing language:python Pull requests that update Python code type:design-change A new proposal or modification to a feature design type:documentation Improvements or additions to documentation type:feature-request A new feature proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Shared Crypto [Feature]: Crypto On Protocol Support [Feature]: Fix Code QL Issues
6 participants